package easystudy.framework;

import java.io.File;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class DownloadController{
	
	@RequestMapping(value="/fr_down.fr")
	protected ModelAndView download(HttpServletRequest req){
		String realPath = req.getRealPath("/WEB-INF/upload");
		String filename = req.getParameter("file_name");
		File downloadFile = new File(realPath,filename);
		System.out.println(downloadFile.getAbsolutePath());
		return new ModelAndView("download","downloadFile",downloadFile);
	}

	
}
